#include "ControllerStack.h"

const std::string ControllerStack::defaul_path = "ControllerStack";

ControllerStack::ControllerStack(const std::string & file_path, int max_size) :
controller_stack(file_path, max_size)
{
	controller_stack.crear();
}

ControllerStack::~ControllerStack()
{
}

unsigned long ControllerStack::pop()
{
	return controller_stack.desapilar();
}

void ControllerStack::push(unsigned long a_controller)
{
	controller_stack.apilar(a_controller);
}

bool ControllerStack::isEmpty() {
	return this->controller_stack.estaVacia();
}

void ControllerStack::init(ControllerStack& a_stack)
{
	PilaCompartida<unsigned long>::inicializarSemaforos(a_stack.controller_stack);
	for(int i=1; i <= a_stack.controller_stack.get_cant_elem_max(); ++i)
		a_stack.push(static_cast<unsigned long>(i));

}
